package com.xy.entity.product;

import com.alibaba.fastjson.annotation.JSONField;

import com.xy.common.jpa.AbstractTimestampEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.math.BigDecimal;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * Date: 2018-01-19
 * Time: 10:30
 */


@Entity
@Data
@Table(name = "rent")
public class Rent  extends AbstractTimestampEntity{


    @ApiModelProperty(value="天数",name="day")
    private int day;
    @ApiModelProperty(value="价格",name="price")
    private BigDecimal price;

    @JSONField(serialize = false)
    @JoinColumn(name = "product_rid")
    @ManyToOne(cascade = {CascadeType.REFRESH}, fetch = FetchType.EAGER)
    private Product product;
}
